package com.gokzzz.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * @author gokzzz
 * @date 2022-04-23 14:37
 */

@Data
@ApiModel("定时任务保存或更新DTO")
public class SysQuartzJobSaveOrUpdateDTO {
    /* 分组校验 */
    public @interface Save {}

    /* 分组校验 */
    public @interface Update {}

    @NotNull(message = "id为空", groups = {Update.class})
    @ApiModelProperty("id")
    private Long id;

    @NotBlank(message = "定时器名称为空", groups = {Save.class, Update.class})
    @ApiModelProperty(value = "定时器名称")
    private String jobName;

    @NotBlank(message = "Bean名称为空", groups = {Save.class, Update.class})
    @ApiModelProperty(value = "Bean名称")
    private String beanName;

    @NotBlank(message = "方法名称为空", groups = {Save.class, Update.class})
    @ApiModelProperty(value = "方法名称")
    private String methodName;

    @ApiModelProperty(value = "参数")
    private String params;

    @NotBlank(message = "cron表达式为空", groups = {Save.class, Update.class})
    @ApiModelProperty(value = "cron表达式")
    private String cronExpression;

    @NotNull(message = "状态为空", groups = {Save.class, Update.class})
    @ApiModelProperty(value = "状态，暂时或启动")
    private Boolean pause;

    @ApiModelProperty(value = "描述")
    private String description;
}
